<?php
/**
 *UserValidate
 * @author tan bing
 * @date 2021-08-10 14:53
 */

namespace Modules\User\Validate\Admin;


use Modules\User\Validate\BaseValidate;

class UserValidate extends BaseValidate
{
    protected $rule = [
        'id' => 'required|integer',
        'nickname' => 'required',
        'user_level_id' => 'required|integer',
        'status' => 'required|in:0,1',
        'mobile' => 'required|mobile',
    ];

    protected $message = [
        'id.required' => 'ID不能为空',
        'id.integer' => 'ID参数错误',
        'nickname.required' => '昵称不能为空',
        'user_level_id.required' => '用户等级不能为空',
        'user_level_id.integer' => '用户等级错误',
        'status.required' => '状态不能为空',
        'status.in' => '状态参数错误',
        'mobile.required' => '手机号不能为空',
        'mobile.mobile' => '手机号格式错误',
    ];

    protected $scene = [
        'edit' => ['id', 'nickname', 'user_level_id', 'mobile'],
        'status' => ['id', 'status'],
    ];
}